package ast.nodes;

import scanner.Token;
import ast.ASTNode;
import ast.Evaluation;

public class CommandNode extends ASTNode {

    public CommandNode(Token data) {
        super(data);
    }
    
    public CommandNode()
    {
        super();
    }

    @Override
    public void run(Evaluation input) throws Exception {
        throw new Exception("No Command Defined.  Shouldn't be here.");
    }

    @Override
    public String toString(int depth) {

        String parametersStr = "";
        for (ASTNode child : getChildren()) {
            parametersStr += child.toString(depth+1);
        }

        return indent(depth) + this.data.getTokenString() + ":" + parametersStr;

    }

}
